package com.sid.oncf.services.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import com.sid.oncf.dao.interfaces.IVoyageDao;
import com.sid.oncf.entity.Voyages;
import com.sid.oncf.services.interfaces.IVoyageService;

@Transactional
public class VoyageServiceImpl implements IVoyageService {
	
	@Autowired
	private IVoyageDao iVoyageDao;

	public boolean saveVoyage(Voyages v) {
		// TODO Auto-generated method stub
		return iVoyageDao.save(v);
	}

	public boolean updateVoyage(Voyages v) {
		// TODO Auto-generated method stub
		return iVoyageDao.update(v);
	}

	public boolean deleteVoyage(int id) {
		// TODO Auto-generated method stub
		return iVoyageDao.delete(id);
	}

	public Voyages findVoyage(int id) {
		// TODO Auto-generated method stub
		return iVoyageDao.find(id);
	}

	public List<Voyages> findAllVoyages() {
		// TODO Auto-generated method stub
		return iVoyageDao.findAll();
	}

	public List<Voyages> rechercheVoyages(int gareDepart, int gareArrivee) {
		// TODO Auto-generated method stub
		return iVoyageDao.recherche(gareDepart, gareArrivee);
	}

}
